package de.wesemann.jdedun.entities.mediahandbook.branches;

import java.util.List;

import de.wesemann.jdedun.entities.AbstractEntity;

public class MediahandbookBranche extends AbstractEntity {

    private String name;
    private int parent_id;
    private String description;
    private String internal_key;
    private String internal_type;
    private List<Integer> companies;

    /**
     * @return the companies
     */
    public List<Integer> getCompanies() {
	return companies;
    }

    /**
     * @param companies
     *            the companies to set
     */
    public void setCompanies(List<Integer> companies) {
	this.companies = companies;
    }

    /**
     * @return the name
     */
    public String getName() {
	return name;
    }

    /**
     * @param name
     *            the name to set
     */
    public void setName(String name) {
	this.name = name;
    }

    // /**
    // * @return the id
    // */
    // public int getId() {
    // return id;
    // }
    //
    // /**
    // * @param id
    // * the id to set
    // */
    // public void setId(int id) {
    // this.id = id;
    // }

    /**
     * @return the parent_id
     */
    public int getParent_id() {
	return parent_id;
    }

    /**
     * @param parent_id
     *            the parent_id to set
     */
    public void setParent_id(int parent_id) {
	this.parent_id = parent_id;
    }

    /**
     * @return the description
     */
    public String getDescription() {
	return description;
    }

    /**
     * @param description
     *            the description to set
     */
    public void setDescription(String description) {
	this.description = description;
    }

    /**
     * @return the internal_key
     */
    public String getInternal_key() {
	return internal_key;
    }

    /**
     * @param internal_key
     *            the internal_key to set
     */
    public void setInternal_key(String internal_key) {
	this.internal_key = internal_key;
    }

    // /**
    // * @return the created_at
    // */
    // public String getCreated_at() {
    // return created_at;
    // }

    // /**
    // * @param created_at
    // * the created_at to set
    // */
    // public void setCreated_at(String created_at) {
    // this.created_at = created_at;
    // }
    //
    // /**
    // * @return the updated_at
    // */
    // public String getUpdated_at() {
    // return updated_at;
    // }
    //
    // /**
    // * @param updated_at
    // * the updated_at to set
    // */
    // public void setUpdated_at(String updated_at) {
    // this.updated_at = updated_at;
    // }

    /**
     * @return the internal_type
     */
    public String getInternal_type() {
	return internal_type;
    }

    /**
     * @param internal_type
     *            the internal_type to set
     */
    public void setInternal_type(String internal_type) {
	this.internal_type = internal_type;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
	final int prime = 31;
	int result = super.hashCode();
	result = prime * result
		+ ((companies == null) ? 0 : companies.hashCode());
	result = prime * result
		+ ((description == null) ? 0 : description.hashCode());
	result = prime * result
		+ ((internal_key == null) ? 0 : internal_key.hashCode());
	result = prime * result
		+ ((internal_type == null) ? 0 : internal_type.hashCode());
	result = prime * result + ((name == null) ? 0 : name.hashCode());
	result = prime * result + parent_id;
	return result;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
	if (this == obj) {
	    return true;
	}
	if (!super.equals(obj)) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	MediahandbookBranche other = (MediahandbookBranche) obj;
	if (companies == null) {
	    if (other.companies != null) {
		return false;
	    }
	} else if (!companies.equals(other.companies)) {
	    return false;
	}
	if (description == null) {
	    if (other.description != null) {
		return false;
	    }
	} else if (!description.equals(other.description)) {
	    return false;
	}
	if (internal_key == null) {
	    if (other.internal_key != null) {
		return false;
	    }
	} else if (!internal_key.equals(other.internal_key)) {
	    return false;
	}
	if (internal_type == null) {
	    if (other.internal_type != null) {
		return false;
	    }
	} else if (!internal_type.equals(other.internal_type)) {
	    return false;
	}
	if (name == null) {
	    if (other.name != null) {
		return false;
	    }
	} else if (!name.equals(other.name)) {
	    return false;
	}
	if (parent_id != other.parent_id) {
	    return false;
	}
	return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
	return "MediahandbookBranche [id=" + super.getId() + ", name=" + name
		+ ", parent_id=" + parent_id + ", description=" + description
		+ ", internal_key=" + internal_key + ", internal_type="
		+ internal_type + ", companies=" + companies + ", create_at="
		+ super.getCreated_at() + ", updated_at="
		+ super.getUpdated_at() + "]";
    }

}
